<template>
  <div class="activityBargain">
    <div class="c-ph24">
      <div class="c-flex-row c-justify-sb c-aligni-center c-hh84">
        <span class="c-fc-xblack c-fs24 c-fw600">正在进行中的砍价</span>
        <span class="c-fc-gray c-fs20" @click="handleClickMyBargain()">查看更多
          <i class="iconfont c-fs16 c-fc-gray">&#xe635;</i>
        </span>
      </div>
      <div class="activity-list c-ph20 c-bg-white c-br20 c-mb30 c-pt18 c-pb22" @click="handleClickBargainActivity(item)" v-for="(item, index) in attendList" :key="index">
        <bargain-time :time="item.endTime" :key="item.attendId" @finshTime="finshTime"></bargain-time>
        <div class="activity-con">
          <p class="c-pt20 c-fc-xblack c-fs24 c-fw400 c-text-ellipsis2">{{item.ticketName}} {{activityName}}</p>
          <div class="c-flex-row c-aligni-center c-pt10">
            <div class="theme-fc c-fs18 c-pr10">已砍{{'￥' | iosPriceFilter}}
              <span class="c-fs24">{{item.hadBargainPrice}}</span>
            </div>
            <span class="c-fs18 c-fc-gray c-text-decoration-through">{{'￥' | iosPriceFilter}}{{item.prodPrice}}</span>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import bargainTime from '@/components/templates/bargain/bargainTime';
export default {
  name: 'ActivityBargain',
  props: {
    attendList: {
      type: Array,
      default: () => []
    },
    activityName: {
      type: String,
      default: ''
    }
  },
  components: {
    bargainTime
  },
  data() {
    return {
      theme: localStorage.getItem("colorName") ? localStorage.getItem("colorName") : 'mb5_default',
    }
  },
  methods: {
    handleClickMyBargain() {
      this.$emit('handleClickMyBargain');
    },
    handleClickBargainActivity(item) {
      this.$emit("handleClickBargainActivity", item)
    },
    finshTime() {
      this.$emit("finshTime")
    },
  }
}
</script>

<style lang="less" scoped>
.activity-list {
  box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
}
</style>